/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.app.model.bo;

import java.io.Serializable;

/**
 *
 * @author KM
 */
public class Entity implements Serializable, IEntity {

    private static final long serialVersionUID = 1L;
    private Long id;

    @Override
    public Long getId() {
        return this.id;
    }

    @Override
    public void setId(Long id) {
        this.id = id;
    }

    @Override
    public boolean dbEquals(IEntity other) {
        if (other == this) {
            return true;
        }
        if (other == null) {
            return false;
        }
        if (getId() == null) {
            return false;
        }
        if (other.getId() == null) {
            return false;
        }
        return getId().equals(other.getId());
    }

    @Override
    public StringBuffer fillProperties(StringBuffer sb) {
        return sb.append("(id=").append(getId()).append(')');
    }

    @Override
    public String toString() {
        return getClass().getName() + " [id=" + this.id + ']';
    }
}
